#pragma once

#include "shape.h"

class MSphere : public Shape
{
private:
	float ox, oy, oz;	//center of sphere
	float r;
	int rs, vs;
	MVertex **verts;
	MVertex **normal;
	int step;
private:
	MSphere(float ar, int ars, int avs,float aox, float aoy,float aoz);
public:
	~MSphere(void);
	static MSphere *makeSphere(float ar, int rs, int vs,float aox = 0, float aoy = 0,float aoz = 0);
	void drawShape();
	void drawSphere(void(*func)(const MVertex &p1,  const MVertex &p2, const MVertex &p3, int ic),
								void(*drawline)(const MVertex &p1,  const MVertex &p2,int ic)=NULL);
	void updateSphere(float ar, int rs, int vs, float aox = 0, float aoy = 0,float aoz = 0);
	bool isComplete() const;
	void resetStep();
	void incrementSlice();
	void decrementSlice();
	void incrementStack();
	void decrementStack();
	void translate(float x, float y, float z);
	void rotate(float deg, int x, int y, int z);
	void rotateAroundOwnAxis(float theta);
	void scale(float x, float y, float z);
};

